<template>
     <el-row>
    <el-input
        type="textarea"
        :rows="2"
        placeholder="请输入淘宝商品链接"
        v-model="textarea">
    </el-input>

    <el-input
        class="content"
        type="textarea"
        :rows="3"
        placeholder="这里展示转换的唤醒链接链接"
        v-model="content">
    </el-input>
   
   
    
  <el-button class="sbtn" type="primary" @click="covertLink" >转换唤醒链接</el-button>
  <el-button class="sbtn" type="success" @click="copy" >复制唤醒链接</el-button>
  <el-button class="sbtn" type="info" @click="clerar" >清空内容</el-button>

</el-row>
</template>

<style>
.sbtn,.content{
    margin-top: 10px;
}
</style>

  
  <script>
  import Copy from 'copy-to-clipboard';
 export default {
  data() {

    return {
      textarea: '',
      content:''
    }
  },
  methods: {
    clerar(){
      this.textarea= '',
      this.content=''
    },
    covertLink() {
      var baseUrl="tbopen://m.taobao.com/tbopen/index.html?source=auto&action=ali.open.nav&module=h5&h5Url=";
      var urlResult=baseUrl+ encodeURIComponent(this.textarea);
      this.content=urlResult;
    },
    copy(){
        Copy(this.content);  
        this.$message('复制链接复制成功')
    }
  }
}
 
  </script>
  